package net.stogi.unicore.beyond.ui.client.taskeditor.taskoutline;

import net.stogi.unicore.beyond.api.model.OutputDefinition;

import com.google.gwt.event.shared.GwtEvent;

public class EditOutputDefinitionEvent extends GwtEvent<EditOutputDefinitionHandler> {

	public static final GwtEvent.Type<EditOutputDefinitionHandler> TYPE = new GwtEvent.Type<EditOutputDefinitionHandler>();

	private OutputDefinition outputDefinition;

	public EditOutputDefinitionEvent(OutputDefinition outputDefinition) {
		this.outputDefinition = outputDefinition;
	}

	@SuppressWarnings("unused")
	private EditOutputDefinitionEvent() {}

	@Override
	public Type<EditOutputDefinitionHandler> getAssociatedType() {
		return TYPE;
	}

	public OutputDefinition getOutputDefinition() {
		return outputDefinition;
	}

	public void setOutputDefinition(OutputDefinition outputDefinition) {
		this.outputDefinition = outputDefinition;
	}

	@Override
	protected void dispatch(EditOutputDefinitionHandler handler) {
		handler.onEditOutputDefinition(this);
	}
}
